-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(more) Syn 2.0 updates #3738
Closed
Closed
(more) Syn 2.0 updates #3738
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…s to our proc macros Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
…proc-macro-error with manyhow Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
…e`. It does it pretty well =) Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
Not crates-io version, because there is a problem with the 0.5.0 release =( Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
n -> version versioned -> versioned_alias Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
It's just strum::EnumCount anyways Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
- use darling's traits to parse the input - cover attributes with tests - add a diagnostic for a common error: attribute on variant instead of field - ensure spans for generated enums are linked to enum variants, which improves "conflicting implementation" errors Signed-off-by: Nikita Strygin <DCNick3@users.noreply.github.com>
github-actions
bot
added
the
iroha2-dev
The re-implementation of a BFT hyperledger in RUST
label
Jul 24, 2023
The changes are now part of #3727 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
NOTE: This PR is based on #3727, so only last 3 commits are actually belong to this PR
This PR refactors
iroha_primitives_derive
crate andVariantCount
macro iniroha_derive
. The gist of the changes: usemanyhow
to report errors anddarling
to parse attributes. Try to improve UX where possible.I've kept API the same for all the macros, but it may be useful to change some of them:
VariantCount
are placed on fields instead of enum variants. I suggest we move them to variants, as it's really a property of the variant#[skip_try_from]
is confusing in the context of#[skip_from]
: the different in names is in thetry
, but they correspond to different directions of the generated conversions:from
is forVariant
->Enum
andtry_from
is forEnum
->Variant
. I suggest changing the name to#[skip_into]
or#[skip_try_into]
to properly represent the change of conversion direction, even if the actual generated trait isFrom
#[skip_container]
to#[skip_from_container]
?I would like some input on this from other team members though ^^
Checklist